<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能办公系统</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">


    <link rel="stylesheet" th:href="${pc} + '/static/css/index.css'" />




    <!-- 引入 Vue -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
    <!-- 引入 ElementUI -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <!-- 引入 ECharts -->
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <!-- 引入 Moment.js -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
    <!-- 引入 Axios -->
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

</head>
<body>
    <div id="app">
        <el-container>
            <!-- 添加侧边栏 -->
            <el-aside :width="isCollapse ? '64px' : '200px'">
                <div class="logo" :class="{'logo-collapse': isCollapse}">
                    <i class="el-icon-eleme"></i>
                    <span style="padding-left: 6px;" v-show="!isCollapse">{{systemTitle}}</span>
                </div>
                <el-menu
                    background-color="transparent"
                    text-color="#fff"
                    active-text-color="#00ffff"
                    :default-active="activeMenu"
                    :default-openeds="[]"
                    class="el-menu-vertical"
                    :collapse="isCollapse"
                    :collapse-transition="false">

                    <el-menu-item index="1">
                        <i class="el-icon-s-home"></i>
                        <span @click="goHomePage" slot="title">首页</span>
                    </el-menu-item>

                    <el-submenu v-for="item in menuList" :index="item.flag">
                        <template slot="title">
                            <i :class="'el-icon-' + item.icon"></i>
                            <span>{{item.name}}</span>
                        </template>
                        <el-menu-item v-for="child in item.sub" :index="child.flag">
                            <i :class="'el-icon-' + child.icon"></i>
                            <span @click="openUrl(item, child)">{{child.name}}</span>
                        </el-menu-item>
                    </el-submenu>

                </el-menu>
            </el-aside>

            <el-container>
                <!-- 添加顶部导航 -->
                <el-header>
                    <div class="header-left">
                        <i class="el-icon-s-fold" @click="toggleCollapse"></i>
                    </div>
                    <div class="header-right">
                        <!-- 消息通知 -->
                        <div class="message-badge" @click="showMessages">
                            <el-badge :value="3" class="message-icon">
                                <i class="el-icon-bell"></i>
                            </el-badge>
                        </div>
                        <!-- 用户信息 -->
                        <div class="user-info">
                            <el-dropdown trigger="click">
                                <span class="user-dropdown">
                                    <i class="el-icon-user-solid"></i>
                                    superAdmin
                                    <i class="el-icon-caret-bottom"></i>
                                </span>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item>
                                        <i class="el-icon-s-custom"></i> 个人中心
                                    </el-dropdown-item>
                                    <el-dropdown-item>
                                        <i class="el-icon-setting"></i> 系统设置
                                    </el-dropdown-item>
                                    <el-dropdown-item >
                                        <span @click="logOutPage">
                                                <i class="el-icon-switch-button"></i> 退出登录
                                        </span>
                                    </el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </div>
                    </div>
                </el-header>

                <!-- 主要内容区域 -->
                <el-main>
                    <div class="container">

                        <div class="module-header" @click="hiddenSearch=!hiddenSearch">
                            <i :class="'fa-solid fa-angle-double-' + ( hiddenSearch ? 'down' : 'up') "></i>
                            <el-link  type="primary" style="color:white;">条件搜索</el-link>
                        </div>
                        <el-card v-show="!hiddenSearch">
                            <!-- 搜索区域 -->
                            <div class="search-area">
                                <el-row gutter="24">
                                         <el-col :span="4">
                                             <el-select v-model="searchForm.category"  @change="c1Changed">
                                                 <el-option v-for="item in c1list" :key="item.id" :value="item.name" :label="item.name" ></el-option>
                                             </el-select>
                                         </el-col>
                                         <el-col :span="6">
                                             <el-select v-model="searchForm.type" >
                                                 <el-option v-for="item in c2list" :key="item.id" :value="item.name" :label="item.name" ></el-option>
                                             </el-select>
                                         </el-col>

                                </el-row>


                                <el-input v-model="searchForm.title" placeholder="请输入标题"></el-input>
                            </div>
                            <!-- 搜索按钮组 -->
                            <div class="search-buttons">
                                <el-button @click="searchByFilter" type="primary" icon="el-icon-search">搜索</el-button>
                                <el-button type="success" icon="el-icon-refresh" @click="resetSearch">重置</el-button>
                            </div>
                        </el-card>



                        <!-- 在三个图表行后添加表格模块 -->
                        <div class="table-module">
                            <div style="display: flex;justify-content: space-between;">
                                <div class="module-header">
                                    <i class="el-icon-tickets"></i>
                                    <span class="table-title-info">网址</span>
                                    <span class="table-title-info"> / </span>
                                    <span class="table-title-info">开放</span>
                                </div>
                                <div>
                                    <!-- 操作按钮组 -->
                                    <div class="action-buttons">
                                        <el-button-group>
                                            <el-button type="primary" @click="dialogVisible = true" icon="el-icon-plus">新建</el-button>
                                            <el-button type="danger" icon="el-icon-download" @click="batchDelete">批量删除</el-button>
                                        </el-button-group>
                                    </div>
                                </div>
                            </div>
                            <div class="table-container">
                                <el-table
                                    :data="tableData"
                                    style="width: 100%"
                                    :header-cell-style="{ background: 'rgba(4, 28, 75, 0.8)', color: '#fff' }"
                                    :cell-style="{ background: 'transparent', color: '#fff' }"
                                    border
                                    @selection-change="handleSelectionChange"
                                >
                                    <el-table-column
                                            type="selection"
                                            width="40"
                                            align="center"
                                    ></el-table-column>
                                    <el-table-column
                                        type="index"
                                        label="序号"
                                        width="80"
                                        align="center">
                                    </el-table-column>
                                    <el-table-column  prop="title" label="标题"  align="left" >
                                        <template slot-scope="scope">
                                            <div style="display: flex; justify-content: space-between;width:96%;margin-left:10px;">
                                                <div>{{ scope.row.title }}</div>
                                                <div style="color:green;font-weight: bold;cursor:pointer;    min-width: 40px;padding-left: 10px;" @click="copyById(scope.row)">复制</div>
                                            </div>
                                        </template>
                                    </el-table-column>

                                    <el-table-column  prop="type" label="分类"  align="center" width="180px"></el-table-column>
                                    <el-table-column  prop="category" label="技术"  align="center" width="120px" ></el-table-column>



                                    <el-table-column
                                        label="操作"
                                        :width="210"
                                        align="center">
                                        <template slot-scope="scope">
                                            <div class="operation-btns">
                                                <el-button type="text" size="small" @click="handleEdit(scope.row)">
                                                    <i class="el-icon-edit"></i>
                                                    <span>编辑</span>
                                                </el-button>
                                                <el-button type="text" size="small" @click="handleCopyOneLine(scope.row.id)">
                                                    <i class="el-icon-view" style="color:green;"></i>
                                                    <span style="color:green;">复制行</span>
                                                </el-button>
                                                <el-button type="text" size="small" class="delete-btn" @click="handleDelete(scope.row)">
                                                    <i class="el-icon-delete" style="color:red;"></i>
                                                    <span style="color:red;">删除</span>
                                                </el-button>
                                            </div>
                                        </template>
                                    </el-table-column>
                                </el-table>
                                
                                <!-- 分页器 -->
                                <div class="pagination-container">
                                    <el-pagination
                                        @size-change="handleSizeChange"
                                        @current-change="handleCurrentChange"
                                        :current-page="pagination.currentPage"
                                        :page-sizes="[10, 20, 30, 50]"
                                        :page-size="pagination.pageSize"
                                        layout="total, sizes, prev, pager, next, jumper"
                                        :total="pagination.total">
                                    </el-pagination>
                                </div>
                            </div>
                        </div>

                        <!-- start:新建对话框 -->
                        <el-dialog
                            title="新建"
                            :visible.sync="dialogVisible"
                            width="50%"
                            :close-on-click-modal="false"
                            :before-close="handleClose">
                            <el-form :model="ruleForm" :rules="rules" ref="formRef" label-width="100px">
                                <el-row :gutter="20">
                                    <el-col :span="12">
                                        <el-form-item label="技术" prop="category">
                                            <el-select v-model="ruleForm.category"  @change="c1ChangedOfDialog" >
                                                <el-option v-for="item in c1list" :key="item.id" :value="item.name" :label="item.name" ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="12">
                                        <el-form-item label="分类" prop="type">
                                            <el-select v-model="ruleForm.type"  >
                                                <el-option v-for="item in c2list" :key="item.id" :value="item.name" :label="item.name" ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row :gutter="20">
                                    <el-col :span="24">
                                        <el-form-item label="状态" prop="status">
                                            <el-switch v-model="ruleForm.status"
                                                       :active-value="1"
                                                       :inactive-value="0" ></el-switch>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-form-item label="标题" prop="title">
                                    <el-input v-model="ruleForm.title" placeholder="请输入标题"></el-input>
                                </el-form-item>
                            </el-form>
                            <span slot="footer" class="dialog-footer">
                                <el-button @click="handleClose">取 消</el-button>
                                <el-button type="primary" @click="submitForm">确 定</el-button>
                            </span>
                        </el-dialog>
                        <!-- 结束:新建对话框 -->



                        <!-- start:修改对话框 -->
                        <el-dialog
                                title="修改"
                                :visible.sync="dialogVisibleOfUpdate"
                                width="50%"
                                :close-on-click-modal="false"
                                :before-close="handleCloseOfUpdate">
                            <el-form :model="ruleFormOfUpdate" :rules="rulesOfUpdate" ref="formRefOfUpdate" label-width="100px">
                                <el-row :gutter="20">
                                    <el-col :span="12">
                                        <el-form-item label="技术" prop="category">
                                            <el-select v-model="ruleFormOfUpdate.category"  @change="c1ChangedOfDialogForEdit" >
                                                <el-option v-for="item in c1list" :key="item.id" :value="item.name" :label="item.name" ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="12">
                                        <el-form-item label="分类" prop="type">
                                            <el-select v-model="ruleFormOfUpdate.type"  >
                                                <el-option v-for="item in c2list" :key="item.id" :value="item.name" :label="item.name" ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row :gutter="20">
                                    <el-col :span="24">
                                        <el-form-item label="状态" prop="status">
                                            <el-switch v-model="ruleFormOfUpdate.status"
                                                       :active-value="1"
                                                       :inactive-value="0" ></el-switch>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-form-item label="标题" prop="title">
                                    <el-input v-model="ruleFormOfUpdate.title" placeholder="请输入标题"></el-input>
                                </el-form-item>
                            </el-form>
                            <span slot="footer" class="dialog-footer">
                                <el-button @click="handleCloseOfUpdate">取 消</el-button>
                                <el-button type="primary" @click="submitFormOfUpdate">确 定</el-button>
                            </span>
                        </el-dialog>
                        <!-- 结束:修改对话框 -->


                        <!-- 在container div内的最底部添加 -->
                        <div class="footer">
                            <div class="footer-content">
                                <div class="footer-section">
                                    <h3>关于我们</h3>
                                    <p>威海市智慧社区管理平台</p>
                                    <p>专注于提供智能化社区解决方案</p>
                                </div>
                                <div class="footer-section">
                                    <h3>联系方式</h3>
                                    <p>电话：400-888-9999</p>
                                    <p>邮箱：support@weihai.gov.cn</p>
                                </div>
                                <div class="footer-section">
                                    <h3>备案信息</h3>
                                    <p>Copyright © 2024 威海市智慧社区</p>
                                    <p>鲁ICP备12345678号-1</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </el-main>
            </el-container>
        </el-container>
    </div>

    <script th:src="@{/static/js/vue-clipboard.min.js}"></script>
    <script th:src="@{/static/js/const.js}"></script>


    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    dialogVisibleOfUpdate: false,
                    ruleFormOfUpdate: {
                        category: 'java',
                        type: '性能优化',
                        title: '',
                        status: 1
                    },
                    rulesOfUpdate: {
                        title: [
                            { required: true, message: '请输入标题', trigger: 'blur' },
                            { min: 2, max: 50, message: '长度在 2 到 90 个字符', trigger: 'blur' }
                        ],
                    },
                    sels: [],
                    hiddenSearch: false,
                    c1list: [],
                    c2list: [],
                    searchForm: {
                        category: 'java',
                        type: '性能优化',
                        title: ''
                    },
                    systemTitle: '智能办公系统',
                    dialogVisible: false,
                    formData: {
                        category: 'java',
                        type: '性能优化',
                        title: '',
                        status: 1
                    },
                    ruleForm: {
                        category: 'java',
                        type: '性能优化',
                        title: '',
                        status: 1
                    },
                    rules: {
                        title: [
                            { required: true, message: '请输入标题', trigger: 'blur' },
                            { min: 2, max: 50, message: '长度在 2 到 90 个字符', trigger: 'blur' }
                        ],
                    },

                    menuList: [],

                    activeMenu: '5-10',  // 修改为默认选中首页
                    isCollapse: false,  // 控制菜单折叠状态
                    chartTimeRange: '7',
                    notices: [],
                    todoFilter: 'all',
                    todos: [],
                    tableData: [],
                    pagination: {
                        currentPage: 1,
                        pageSize: 10,
                        total: 100
                    },
                    pickerOptions: {
                        shortcuts: [{
                            text: '最近一周',
                            onClick(picker) {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                                picker.$emit('pick', [start, end]);
                            }
                        }, {
                            text: '最近一个月',
                            onClick(picker) {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                                picker.$emit('pick', [start, end]);
                            }
                        }, {
                            text: '最近三个月',
                            onClick(picker) {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                                picker.$emit('pick', [start, end]);
                            }
                        }]
                    },
                    value2: [new Date(2025, 1, 1, 0, 0, 0), new Date(2025, 2, 11, 23, 59, 59)],
                    value1: ''
                }
            },
            computed: {
                completedTodos() {
                    return this.todos.filter(todo => todo.done).length;
                }
            },
            methods: {


                copyWifiPwd(row) {
                    this.$copyText(row.title)
                        .then(e => this.$message.success('复制成功！'),
                            e => this.$message.error('操作异常!'))
                },

                searchByFilter() {
                    // 在这里实现搜索逻辑
                    this.pagination.currentPage = 1;
                    this.loadTableData()
                },

                resetSearch() {
                    // 在这里实现重置逻辑
                    this.searchForm.title = '';
                    this.pagination.currentPage = 1;
                    this.loadTableData()
                },

                handleClose() {
                    this.$refs.formRef.resetFields();
                    this.dialogVisible = false;
                },
                handleCloseOfUpdate() {
                    this.$refs.formRefOfUpdate.resetFields();
                    this.dialogVisibleOfUpdate = false;
                },
                submitFormOfUpdate() {
                    this.$refs.formRefOfUpdate.validate((valid) => {
                        if (valid) {
                            // TODO: 处理表单提交
                            console.log('表单数据:', this.ruleFormOfUpdate);
                            // this.$message.success('提交成功');
                            axios.put(cst.gateway + cst.module.tech + "/question/title/" + "save_update", this.ruleFormOfUpdate)
                                .then(response => {
                                    if (response.data.code === 200) {
                                        this.$message.success('修改成功');
                                        this.loadTableData()
                                    } else {
                                        this.$message.error(response.data.msg);
                                    }
                                    this.handleCloseOfUpdate();
                                })
                                .catch(error => {
                                    this.$message.error('提交失败');
                                    console.error('提交失败:', error);
                                })
                        } else {
                            this.$message.error('请检查表单信息！');
                            return false;
                        }
                    });
                },
                submitForm() {
                    this.$refs.formRef.validate((valid) => {
                        if (valid) {
                            // TODO: 处理表单提交
                            console.log('表单数据:', this.ruleForm);
                            // this.$message.success('提交成功');
                            axios.post(cst.gateway + cst.module.tech + "/question/title/" + "save_insert", this.ruleForm)
                              .then(response => {
                                    if (response.data.code === 200) {
                                        this.$message.success('保存成功');
                                        this.loadTableData()
                                    } else {
                                        this.$message.error(response.data.msg);
                                    }
                                    this.handleClose();
                                })
                                .catch(error => {
                                    this.$message.error('提交失败');
                                    console.error('提交失败:', error);
                                })
                        } else {
                            this.$message.error('请检查表单信息！');
                            return false;
                        }
                    });
                },
                // 切换菜单折叠状态
                toggleCollapse() {
                    this.isCollapse = !this.isCollapse;
                },
                // 添加菜单点击处理方法
                handleSelect(index, indexPath) {
                    this.activeMenu = index;
                    // 根据需要处理路由跳转或其他逻辑
                },

                handleSizeChange(val) {
                    this.pagination.pageSize = val;
                    this.loadTableData();
                },
                handleCurrentChange(val) {
                    this.pagination.currentPage = val;
                    this.loadTableData();
                },
                handleEdit(row) {
                    console.log('编辑', row);
                    // TODO: 实现编辑功能
                    this.ruleFormOfUpdate = row
                    this.dialogVisibleOfUpdate = true
                },
                handleCopyOneLine(id) {
                    axios.post(cst.gateway + cst.module.tech + "/question/title/" + "copy_one_line/" + id, {})
                      .then((response) => {
                            if (response.data.code === 200) {
                                this.$message.success('复制成功');
                                this.loadTableData()
                            } else {
                                this.$message.error(response.data.msg);
                            }
                      });
                },
                handleView(row) {
                    console.log('查看', row);
                    // TODO: 实现查看功能
                },
                handleDelete(row) {
                    this.$confirm(`确认删除<span style="color:red;">${row.title}</span>吗？`, '提示', {
                        dangerouslyUseHTMLString: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        // 用户点击了确定按钮
                        console.log('用户确认删除');
                        var idsInfo = [row.id];
                        // 在这里执行删除操作
                        const params = { ids:  idsInfo}
                        axios.delete(cst.gateway + cst.module.tech + "/question/title/" + "delete_batch", {
                            data: params
                        })
                            .then((response) => {
                                if (response.data.code === 200) {
                                    this.$message.success('删除成功');
                                    if (this.pagination.currentPage > 1 && idsInfo.length == this.tableData.length) {
                                        this.pagination.currentPage = this.pagination.currentPage - 1 ;
                                    }
                                    this.loadTableData()
                                } else {
                                    this.$message.error(response.data.msg);
                                }
                            })
                        ;
                    }).catch(() => {});
                },
                loadTableData() {
                    this.searchForm.cpage = this.pagination.currentPage
                    this.searchForm.csize = this.pagination.pageSize
                    axios.get(cst.gateway + cst.module.tech + "/question/title/" + "paged", {
                        params: this.searchForm
                    })
                        .then((response) => {
                            if (response.data.code === 200) {
                                const info = response.data.data;
                                this.tableData = info.list;
                                this.pagination.total = info.total;
                            } else {
                                this.$message.error(response.data.msg);
                            }
                        })
                },
                showMessages() {
                    // TODO: 显示消息列表
                    this.$message({
                        message: '您有3条未读消息',
                        type: 'info'
                    });
                },
                logOutPage() {
                    window.location.href = '/pc' + '/login';
                },
                clearCompletedTodos() {
                    this.todos = this.todos.filter(todo => !todo.done);
                },
                loadMenus() {
                    axios.get(cst.gateway + cst.module.auth + "/sysinfo/menu/" + "sidebar")
                        .then((response) => {
                            if (response.data.code === 200) {
                                this.menuList = response.data.data;
                            } else {
                                this.$message.error(response.data.msg);
                            }
                        })
                },
                openUrl(dir, item) {
                    window.location.href = "/pc" + "/data" + dir.url+ item.url + "?t=" + new Date().getTime();
                },
                goHomePage() {
                    window.location.href = "/pc"  + "/index";
                },
                copyById(row) {
                    // this.$message.info(id)?
                    this.copyWifiPwd(row)
                },

                c1Changed() {
                    const params = {}
                    const id = this.c1list.filter(x => x.name == this.searchForm.category)[0].id
                    axios.get(cst.gateway + cst.module.tech + "/question/title/" + "type/" + id, { params })
                        .then(subRes => {
                            this.searchForm.type = ''
                            this.c2list = subRes.data.data
                            if (this.c2list && this.c2list.length > 0) {
                                this.searchForm.type = this.c2list[0].name
                            }
                        })
                },

                c1ChangedOfDialog() {
                    const params = {}
                    const id = this.c1list.filter(x => x.name == this.ruleForm.category)[0].id
                    axios.get(cst.gateway + cst.module.tech + "/question/title/" + "type/" + id, { params })
                        .then(subRes => {
                            this.ruleForm.type = ''
                            this.c2list = subRes.data.data
                            if (this.c2list && this.c2list.length > 0) {
                                this.ruleForm.type = this.c2list[0].name
                            }
                        })
                },

                c1ChangedOfDialogForEdit() {
                    const params = {}
                    const id = this.c1list.filter(x => x.name == this.ruleFormOfUpdate.category)[0].id
                    axios.get(cst.gateway + cst.module.tech + "/question/title/" + "type/" + id, { params })
                        .then(subRes => {
                            this.ruleFormOfUpdate.type = ''
                            this.c2list = subRes.data.data
                            if (this.c2list && this.c2list.length > 0) {
                                this.ruleFormOfUpdate.type = this.c2list[0].name
                            }
                        })
                },

                loadC1list() {
                    const params = {}
                    axios.get(cst.gateway + cst.module.tech + "/question/title/" + "type/" + 0, { params })
                        .then(res => {
                            this.c1list = res.data.data
                            if (this.c1list && this.c1list.length > 0) {
                                this.searchForm.category = this.c1list[0].name
                                // sub
                                const p2 = {}
                                axios.get(cst.gateway + cst.module.tech + "/question/title/" + "type/" + this.c1list[0].id, { params: p2 })
                                    .then(subRes => {
                                        this.c2list = subRes.data.data
                                        if (this.c2list && this.c2list.length > 0) {
                                            this.searchForm.type = this.c2list[0].name
                                        }
                                    })

                            }
                        })
                },

                handleSelectionChange(val) {
                    this.sels = val;
                },

                batchDelete() {
                    if (this.sels.length === 0) {
                        this.$message.error('请选择要删除的行');
                        return;
                    } else {
                        this.$confirm(`确认删除选中的${this.sels.length}行吗？`, '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        })
                            .then(() => {
                                // 用户点击了确定按钮
                                console.log('用户确认删除');
                                var idsInfo = this.sels.map(item => item.id);
                                // 在这里执行删除操作
                                const params = { ids:  idsInfo}
                                axios.delete(cst.gateway + cst.module.tech + "/question/title/" + "delete_batch", {
                                    data: params
                                })
                                   .then((response) => {
                                        if (response.data.code === 200) {
                                            this.$message.success('删除成功');
                                            if (this.pagination.currentPage > 1 && idsInfo.length == this.tableData.length) {
                                                this.pagination.currentPage = this.pagination.currentPage - 1 ;
                                            }
                                            this.loadTableData()
                                        } else {
                                            this.$message.error(response.data.msg);
                                        }
                                    })
                                ;
                            })
                            .catch(() => {
                                // 用户点击了取消按钮
                                console.log('用户取消删除');
                            });
                    }
                },

            },
            mounted() {
                this.loadMenus();
                //

                this.loadC1list();

                this.loadTableData();
            }
        })
    </script>
</body>
</html>

